﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using X.Core.Bases;
using X.Core.Interfaces;

namespace X.Core.Models
{
    public class TreeNodeModel : ParameterModelBase, ITreeNodeModel
    {
        public TreeNodeModel() : base()
        {
            
        }
        #region 'Fields'
        bool _canAddChild;
        bool _isExpanded;
        bool _isCurrent;
        bool _isRoot;
        bool _isChecked;
        bool _isVisible;
        object _root;
        object _parent;
        string _icon;
        #endregion

        #region 'Properties'
        public virtual bool CanAddChild { get => _canAddChild; set => SetProperty(ref _canAddChild, value); }
        public virtual bool IsExpanded { get => _isExpanded; set => SetProperty(ref _isExpanded, value); }
        public virtual bool IsCurrent { get => _isCurrent; set => SetProperty(ref _isCurrent, value); }
        public virtual bool IsRoot { get => _isRoot; set => SetProperty(ref _isRoot, value); }
        public virtual bool IsChecked { get => _isChecked; set => SetProperty(ref _isChecked, value); }
        public virtual bool IsVisible { get => _isVisible; set => SetProperty(ref _isVisible, value); }
        public virtual object Root { get => _root; set => SetProperty(ref _root, value); }
        public virtual object Parent { get => _parent; set => SetProperty(ref _parent, value); }
        [JsonIgnore]
        public virtual string Icon { get => _icon; set => SetProperty(ref _icon, value); }
        public virtual ObservableCollection<ITreeNodeModel> Items { get; set; }
        #endregion
    }
}
